//
//  SecondTableViewCell.m
//  味·道
//
//  Created by 刘孝纯 on 15/6/30.
//  Copyright (c) 2015年 WMR. All rights reserved.
//

#import "SecondTableViewCell.h"
#import "MaocHeader.h"
#import <UIImageView+WebCache.h>

@implementation SecondTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _imageview = [[UIImageView alloc] initWithFrame:CGRectMake(5, 20, SCREEN_WIDTH-10, 150)];
        _typeLable = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, 50, 10)];
        _typeLable.font = [UIFont systemFontOfSize:10];
        _titleLable = [[UILabel alloc] initWithFrame:CGRectMake(5, 175, SCREEN_WIDTH-10, 10)];
        _titleLable.textAlignment = NSTextAlignmentCenter;
        _titleLable.font = [UIFont systemFontOfSize:10];
        
        [self.contentView addSubview:_imageview];
        [self.contentView addSubview:_typeLable];
        [self.contentView addSubview:_titleLable];
        
        [_imageview release];
        [_typeLable release];
        [_titleLable release];
    }
    return self;
}
-(void)setModel:(Recommend3Model *)model
{
    if (model != _model) {
        [_model release];
        _model = [model retain];
    }
    [_imageview sd_setImageWithURL:[NSURL URLWithString:model.thumb]  placeholderImage:[UIImage imageNamed:@"placeholder"]];
    _typeLable.text = @"早餐";
    _titleLable.text = model.title;
}
@end
